<?php

namespace App\Http\Controllers\OA;

use App\Http\Controllers\Controller;
use App\Http\Controllers\Logic\UserLogic;
use Illuminate\Http\Request;

class UserController extends Controller
{
    //用户列表
    public function userList(Request $request)
    {
        $rules = [
            'username'=>'present|exists:oas_staff,username|string',
            'state'=>'present|exists:oas_staff,state|numeric',
            'account'=>'present|exists:oas_staff,account|string',
        ];
        $this->verify($request->all(),$rules);
        try{
            $logic = new UserLogic();
            $list = $logic->getUserList();
            ret_json('ok','ok',$list);
        }catch(\Exception $e){
            ret_json('err',$e->getMessage());
        }
    }
}
